<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <div id="app">
        <input type="text" v-model="name" />
        <div>{{name | upper}}</div>
    </div>
    <script src="../vue.js"></script>
    <script>
        // Vue.filter('upper', function(val) {
        //     return val.charAt(0).toUpperCase() + val.slice(1);
        // });
        // Vue.filter('upper', function(val) {
        //     return val.charAt(0).toLowerCase() + val.slice(1);
        // });
        var vm = new Vue({
            el: '#app',
            data: {
                name: '',
            },
            filters: {
                upper: function(val) {
                    return val.charAt(0).toUpperCase() + val.slice(1);
                },
            },
        });
    </script>
</body>

</html>